<template>
  <div class="remarks-style">
    <div
      class="remarks-style-conetnt"
      :style="{ backgroundImage: `url(${publicUrls + 'free/style17/scrollBcakground.png'})` }"
    >
      <div class="remarks-style-left">
        <div class="title-box">
          <div class="title">
            <div class="childTitle">
              <span class="title-text">{{ store.childTitle }}</span>
              <div @click="store.setChildRemarksShow(false)" class="close-box">
                <img :src="publicUrls + 'free/style17/otherCloseBtn.png'" alt="" />
              </div>
              <p class="SubTitle" v-if="store.childSubTitle">——{{ store.childSubTitle }}</p>
              <img :src="publicUrls + 'free/style17/titleBg.png'" alt="" class="titleBg" />
            </div>
          </div>
        </div>
        <scrollBox
          color="#640400"
          v-if="Scrollheights"
          :remarks="store.childRemarks"
          :byid="100"
          :height="getScrollWComputed"
        >
          <template #solidBorder>
            <div class="solidBorder-child"></div>
          </template>
        </scrollBox>
      </div>
    </div>
    <div class="remarks-style--border"></div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'style17',
});
</script>

<script setup lang="ts">
import { getTextHtml, publicUrls } from '@/utils/minxin';
import scrollBox from '../scrollBox.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';
import { urls } from '@/utils/request/upload';

const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 368;
const getScrollWComputed = computed(() => {
  if (store.isMobileType) {
    let rootNode = document.documentElement;

    // 获取计算后的样式
    let computedStyle = window.getComputedStyle(rootNode);

    // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
    let fontSize = computedStyle.fontSize;

    // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
    // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
    let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
    // let heights = (fontSizeNumber / 144)
    let heights = (fontSizeNumber / 144) * 368;
    return heights;
  } else {
    return Scrollheights.value;
  }
});
</script>   

<style scoped lang="less">
.remarks-style {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 1200px;
  max-width: 1200px;
  height: 720px;
  background: transparent;
  transform: translateZ(0px);
}
.remarks-style-conetnt {
  display: flex;
  width: 100%;
  height: 100%;
  //   background: #fff;
  background-repeat: repeat;
  background-size: 100% 100%;
  padding: 95px 0;
}
.title-box {
  width: 100%;
  margin-bottom: 40px;
  .title {
    width: 100%;
    .childTitle {
      width: 100%;
      height: auto;
      text-align: center;
      position: relative;
      .title-text {
        font-family: SourceHanSerifCN-Bold;
        font-size: 32px;
        background: linear-gradient(359deg, #7f1a10 0.03%, #99241b 99.97%);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        line-height: 48px;
        position: relative;
        &::after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 0;
          width: 100%;
          height: 1px;
          background: #7f1a10;
        }
      }
      .close-box {
        width: 30px;
        height: 30px;
        cursor: pointer;
        z-index: 30;
        position: absolute;
        right: 30px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          width: 24px;
          height: 24px;
          object-fit: contain;
        }
      }
      .titleBg {
        width: 132px;
        height: 63px;
        z-index: 30;
        position: absolute;
        top: -15px;
        left: 50%;
        transform: translateX(-50%);
      }
    }
    .SubTitle {
      font-size: 20px;
      background: linear-gradient(359deg, #7f1a10 0.03%, #99241b 99.97%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      line-height: 28px;
      text-align: center;
      margin-top: 10px;
    }
  }
}
.remarks-style-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding-left: 40px;
  padding-right: 40px;
  height: 100%;
}
.solidBorder-child {
  width: 4px;
  height: 100%;
  background: rgba(153, 36, 27, 0.3);
}
// ::v-deep .scrollBar {
//   width: 1px;
//   height: 100%;
//   background: rgba(131, 176, 179, 0.6);
// }
::v-deep .templatestyle1-scroll-box-tumb {
  align-items: center;
  justify-content: center;
  img {
    width: 24px;
    height: 16px;
  }
}
::v-deep .unit-exbit-null-remarks-info {
  padding: 0 40px;
}
::v-deep {
  .solid-box-parent {
    width: 32px;
  }

  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 32px);
    p {
      color: #640400;
    }
  }
  .solidBorder-child {
    width: 4px;
    background: rgba(153, 36, 27, 0.3);
    border-radius: 25px;
  }
  .scrollBar {
    width: 4px;
    height: 20px;
    background: rgba(153, 36, 27, 1);
    border-radius: 25px;
  }
}
</style>
